package n9;

public class Main {
    public static boolean isPalindrome(int x) {
        String numStr = String.valueOf(x);
        StringBuffer returnStr = new StringBuffer();
        for (int i = 0; i < numStr.length(); i++) {
            char c = numStr.charAt(numStr.length() - i - 1);
            returnStr.append(c);
        }
        return numStr.equals(returnStr.toString());
    }

    public static void main(String[] args) {
        int[] testNum = {121, -121, 10};
        for (int i : testNum) {
            System.out.println(isPalindrome(i));
        }
    }
}
